<template>
    <div class="app">
        <dv-border-box-8>
            <div id="mains" class="w100 h100"></div>
        </dv-border-box-8>
    </div>
</template>

<script>
export default {
    data() {
        return {
            option: {}
        };
    },
    mounted() {
        var chartDom = document.getElementById('mains');
        var myChart = this.$echarts.init(chartDom);
        this.option = {
            legend: {},
            tooltip: {},
            dataset: {
                source: [
                    ['product', '2015', '2016'],
                    ['Matcha Latte', 43.3, 85.8],
                    ['Milk Tea', 83.1, 73.4],
                    ['Cheese Cocoa', 86.4, 65.2],
                    ['a', 42.4, 23.9],
                    ['b', 42.4, 23.9],
                    ['c', 42.4, 23.9],
                ]
            },

            title: {
                text: '',
                x: 'center',
                textStyle: {//标题颜色
                    color: "#fff"
                }
            },
            legend: {
                top: 10,
                textStyle: {
                    color: "#fff"
                }
            },

            xAxis: {
                type: 'category',
                axisLine: {  //这是x轴文字颜色
                    lineStyle: {
                        color: "#fff",
                    }
                }
            },
            yAxis: {
                axisLine: {//这是y轴文字颜色
                    type: 'value',
                    lineStyle: {
                        color: "#fff",
                    }
                }
            },
            // Declare several bar series, each will be mapped
            // to a column of dataset.source by default.
            series: [
                {
                    type: 'bar',
                    barWidth: 20,
                    itemStyle: {
                        color: ''
                    },
                    label: {
                        normal: {
                            show: true,
                            position: 'top',
                            color: "#fff"
                        }
                    },


                },
                {
                    type: 'bar',
                    barWidth: 20,
                }
            ]
        };

        myChart.setOption(this.option);
    },

    created() {

    },
}
</script>

<style lang="scss" scoped>
.app {
    flex: 1;
    // background-color: #fff;
    height: 100%;
    margin-right: 25px;
}
</style>